<!DOCTYPE html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/blog/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/blog/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/blog/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/blog/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="MySQL,">










<meta name="description" content="背景1、学习数据库自带函数的功能与用法（思考在什么情况下可以执行命令） 2、将所有涉及的函数进行测试并举例说明其用法并形成报告扩展学习：针对自己所选数据库，尝试执行系统命令，自己构造所需环境。 前提条件 环境配置如下：win2003+MySQL。  MySQL函数字符串型ASCII函数 返回字符串s的第一个字符的ASCII码。ascii（s）  实例： 1select ascii(&amp;apos; &amp;">
<meta name="keywords" content="MySQL">
<meta property="og:type" content="article">
<meta property="og:title" content="MySQL函数及其利用">
<meta property="og:url" content="https://gitee.com/blghost/blog.git/2019/10/24/MySQL函数及其利用/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="背景1、学习数据库自带函数的功能与用法（思考在什么情况下可以执行命令） 2、将所有涉及的函数进行测试并举例说明其用法并形成报告扩展学习：针对自己所选数据库，尝试执行系统命令，自己构造所需环境。 前提条件 环境配置如下：win2003+MySQL。  MySQL函数字符串型ASCII函数 返回字符串s的第一个字符的ASCII码。ascii（s）  实例： 1select ascii(&amp;apos; &amp;">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571918336041.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571919876363.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571920526176.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571920577704.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571923406964.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571923653334.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571925224450.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571927088779.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572066704083.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572064703956.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572066113006.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572064938939.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572064992325.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572068612303.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572068627713.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572065111522.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572065848068.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572065323113.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572066862198.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572065656366.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572067146818.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572068501292.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572065984104.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572066329013.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572067242997.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572067624509.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572068147384.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572068164825.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572068227181.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572085653778.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572085789090.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572086207817.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572086557657.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572150131302.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572243526558.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572243874860.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572243903812.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572249153923.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572244342671.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572244516352.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572245067511.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572247642656.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572248088092.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572248962039.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572249329035.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572249451325.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572256910711.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572425002692.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572425057962.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572425225851.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572426463247.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572426533618.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572426825178.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572511901871.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572512279462.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572512512155.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572512733708.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572512907630.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572513078456.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572513216000.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572513322697.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572513451340.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572513574056.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572513740031.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572594559005.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572594846610.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572595076152.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572595110739.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572595371073.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572595406062.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572595554860.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572596545176.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572597423927.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572611679828.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572612179011.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572612690723.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572612495288.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572613190270.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572614764654.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572615667584.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572859091222.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572860557822.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572861635132.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572862035170.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572862452239.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572862970285.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1573025960234.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1573026020175.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1573026126803.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572863214780.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572864200577.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572864439679.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1573026263869.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1573025615288.png">
<meta property="og:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1573026304666.png">
<meta property="og:updated_time" content="2019-11-07T03:43:25.475Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="MySQL函数及其利用">
<meta name="twitter:description" content="背景1、学习数据库自带函数的功能与用法（思考在什么情况下可以执行命令） 2、将所有涉及的函数进行测试并举例说明其用法并形成报告扩展学习：针对自己所选数据库，尝试执行系统命令，自己构造所需环境。 前提条件 环境配置如下：win2003+MySQL。  MySQL函数字符串型ASCII函数 返回字符串s的第一个字符的ASCII码。ascii（s）  实例： 1select ascii(&amp;apos; &amp;">
<meta name="twitter:image" content="c:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571918336041.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/blog/',
    scheme: 'Muse',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://gitee.com/blghost/blog.git/2019/10/24/MySQL函数及其利用/">





  <title>MySQL函数及其利用 | Hexo</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/blog/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Hexo</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/blog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/blog/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://gitee.com/blghost/blog.git/blog/2019/10/24/MySQL函数及其利用/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Blackghost">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Hexo">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">MySQL函数及其利用</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-10-24T18:03:00+08:00">
                2019-10-24
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="背景"><a href="#背景" class="headerlink" title="背景"></a>背景</h2><p>1、学习数据库自带函数的功能与用法（思考在什么情况下可以执行命令）</p>
<p>2、将所有涉及的函数进行测试并举例说明其用法并形成报告扩展学习：针对自己所选数据库，尝试执行系统命令，自己构造所需环境。</p>
<h2 id="前提条件"><a href="#前提条件" class="headerlink" title="前提条件"></a>前提条件</h2><ul>
<li>环境配置如下：win2003+MySQL。</li>
</ul>
<h2 id="MySQL函数"><a href="#MySQL函数" class="headerlink" title="MySQL函数"></a>MySQL函数</h2><h3 id="字符串型"><a href="#字符串型" class="headerlink" title="字符串型"></a>字符串型</h3><h4 id="ASCII函数"><a href="#ASCII函数" class="headerlink" title="ASCII函数"></a>ASCII函数</h4><ul>
<li>返回字符串s的第一个字符的ASCII码。ascii（s）</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select ascii(&apos; &apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571918336041.png" alt="1571918336041"></p>
<h4 id="长度计算函数"><a href="#长度计算函数" class="headerlink" title="长度计算函数"></a>长度计算函数</h4><p>返回字符串s的字符数</p>
<ul>
<li>CHAR_LENGTH（s）</li>
<li>CHARACTER_LENGTH（s）  【不管汉字、数字还是英文都算1个字符】</li>
<li>LENGTH（s）【utf8字符编码下，一个汉字算三个字符，一个数字或一个字母算一个字符。其他编码情况下，一个汉字算两个字符。一个数字或字母算一个字符。】</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Select length(&quot;aaa&quot;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571919876363.png" alt="1571919876363"></p>
<h4 id="合并字符串函数"><a href="#合并字符串函数" class="headerlink" title="合并字符串函数"></a>合并字符串函数</h4><p>把s1，s2等多个字符串合并为一个字符串，并返回结果出去。</p>
<ul>
<li>CONCAT(s1,s2,…sn)</li>
<li>CONCAT_WS(x,s1,s2,….sn)  多个字符串用x加以分割。</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select concat(&apos;sql&apos;,&apos;123&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571920526176.png" alt="1571920526176"></p>
<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571920577704.png" alt="1571920577704"></p>
<h4 id="查找多个字符位置"><a href="#查找多个字符位置" class="headerlink" title="查找多个字符位置"></a>查找多个字符位置</h4><ul>
<li>返回在s1，s2…sn之间查找s字符串的所在位置。FIELD(s,s1,s2….sn)；方便单个单个输入。</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select field(&quot;1&quot;,&apos;1&apos;,&apos;2&apos;,&apos;3&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571923406964.png" alt="1571923406964"></p>
<h4 id="查找单个字符位置"><a href="#查找单个字符位置" class="headerlink" title="查找单个字符位置"></a>查找单个字符位置</h4><ul>
<li>返回在字符串s2中与s1匹配的字符串的位置。find_in_set(s1,s2)；输入一整个。</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select find_in_set(&apos;1&apos;,&apos;4,1,6,8,4,5&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571923653334.png" alt="1571923653334"></p>
<h4 id="格式化数字函数"><a href="#格式化数字函数" class="headerlink" title="格式化数字函数"></a>格式化数字函数</h4><ul>
<li>函数将数字x进行格式化；“####.##”将x保留到小数点后n位，最后一位四舍五入。format(x,n)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select format(25000.0346,2);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571925224450.png" alt="1571925224450"></p>
<h4 id="替换字符串函数"><a href="#替换字符串函数" class="headerlink" title="替换字符串函数"></a>替换字符串函数</h4><ul>
<li>字符串s2替换s1的x位置开始长度为len的字符串。insert(s1,x,len,s2)</li>
<li>将字符串s2替代字符串s中的字符串s1。replace（s,s1,s2）</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select insert(&apos;aaa&apos;,2,2,&apos;bb&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1571927088779.png" alt="1571927088779"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select replace(&quot;abc&quot;,&apos;a&apos;,&apos;x&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572066704083.png" alt="1572066704083"></p>
<h4 id="查找字符串函数"><a href="#查找字符串函数" class="headerlink" title="查找字符串函数"></a>查找字符串函数</h4><ul>
<li>从字符串s中获取s1的开始位置。locate（s1,s）</li>
<li>原理同上。position(s in s1)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select locate(&quot;3&quot;,&quot;4136874&quot;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572064703956.png" alt="1572064703956"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select position(&quot;a&quot; in &quot;bac&quot;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572066113006.png" alt="1572066113006"></p>
<h4 id="转换为小写函数"><a href="#转换为小写函数" class="headerlink" title="转换为小写函数"></a>转换为小写函数</h4><ul>
<li>lcase（s）</li>
<li>lower（s）将字符串s的所有字母变成小写字母</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select lcase(&quot;RUNNN&quot;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572064938939.png" alt="1572064938939"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select lower(&quot;RYUNNN&quot;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572064992325.png" alt="1572064992325"></p>
<h4 id="转换为大写函数"><a href="#转换为大写函数" class="headerlink" title="转换为大写函数"></a>转换为大写函数</h4><p>将字符串s转换为大写</p>
<ul>
<li>ucase(s)</li>
<li>upper(s)</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select ucase(&quot;aa&quot;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572068612303.png" alt="1572068612303"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select upper(&quot;bb&quot;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572068627713.png" alt="1572068627713"></p>
<h4 id="返回字符串函数"><a href="#返回字符串函数" class="headerlink" title="返回字符串函数"></a>返回字符串函数</h4><ul>
<li>返回字符串s的前n个字符。left(s,n)</li>
<li>返回字符串s的后n个字符。right(s,n)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select left(&quot;bug123&quot;,3);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572065111522.png" alt="1572065111522"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select right(&quot;123bug&quot;,3);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572065848068.png" alt="1572065848068"></p>
<h4 id="填充字符串函数"><a href="#填充字符串函数" class="headerlink" title="填充字符串函数"></a>填充字符串函数</h4><ul>
<li>在字符串s1的开始处填充字符串s2，使字符串长度达到len。lpad(s1,len,s2);</li>
<li>在字符串s1的结尾处填充字符串s2，使字符串长度达到len。rpad(s1,len,s2);</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select lpad(&quot;abc&quot;,6,&quot;aaa&quot;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572065323113.png" alt="1572065323113"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select rpad(&apos;ac&apos;,6,&apos;tion&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572066862198.png" alt="1572066862198"></p>
<h4 id="去除空格函数"><a href="#去除空格函数" class="headerlink" title="去除空格函数"></a>去除空格函数</h4><ul>
<li>去掉字符串s开始处的空格。ltrim(s)</li>
<li>去掉字符串s结尾处的空格。rtrim(s)</li>
<li>去掉字符串s开头和结尾处的空格。trim(s)。</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select ltrim(&quot;   ccc&quot;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572065656366.png" alt="1572065656366"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select rtrim(&quot;ccc   &quot;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572067146818.png" alt="1572067146818"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select trim(&quot;  cc  &quot;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572068501292.png" alt="1572068501292"></p>
<h4 id="截取字符串函数"><a href="#截取字符串函数" class="headerlink" title="截取字符串函数"></a>截取字符串函数</h4><ul>
<li>从字符串s的n位置截取长度为len的字符串，同【SUBSTRING/SUBSTR / mid(s,n,len)】</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select mid(&quot;aababahadca&quot;,4,3);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572065984104.png" alt="1572065984104"></p>
<h4 id="重复复制字符串"><a href="#重复复制字符串" class="headerlink" title="重复复制字符串"></a>重复复制字符串</h4><ul>
<li>将字符串s重复n次。repeat(s,n)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select repeat(&quot;aa&quot;,3);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572066329013.png" alt="1572066329013"></p>
<h4 id="返回空格函数"><a href="#返回空格函数" class="headerlink" title="返回空格函数"></a>返回空格函数</h4><ul>
<li>返回n个空格。space（n）</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select space(10);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572067242997.png" alt="1572067242997"></p>
<h4 id="字符串比较函数"><a href="#字符串比较函数" class="headerlink" title="字符串比较函数"></a>字符串比较函数</h4><ul>
<li>比较字符串s1和s2，如果s1与s2相等返回0，如果s1&gt;s2 返回1。如果s1&lt;s2 返回 -1。strcmp(s1,s2)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select strcmp(&quot;aa&quot;,&quot;bb&quot;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572067624509.png" alt="1572067624509"></p>
<h4 id="分割字符串函数"><a href="#分割字符串函数" class="headerlink" title="分割字符串函数"></a>分割字符串函数</h4><p>返回从字符串s的第num个出现的分割符x之后的字符串。substring_index(s,x,num)</p>
<ul>
<li>如果num是正数，返回num个字符左边的字符串。</li>
<li>如果num是负数，返回num的绝对值（从右边数）个字符右边的字符串。</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select substring_index(&apos;a-b&apos;,&quot;-&quot;,1);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572068147384.png" alt="1572068147384"></p>
<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572068164825.png" alt="1572068164825"></p>
<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572068227181.png" alt="1572068227181"></p>
<h3 id="数值型"><a href="#数值型" class="headerlink" title="数值型"></a>数值型</h3><h4 id="绝对值函数"><a href="#绝对值函数" class="headerlink" title="绝对值函数"></a>绝对值函数</h4><ul>
<li>返回x的绝对值。abs(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select abs(-1);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572085653778.png" alt="1572085653778"></p>
<h4 id="反余弦函数"><a href="#反余弦函数" class="headerlink" title="反余弦函数"></a>反余弦函数</h4><ul>
<li>求x的反余弦值。acos(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select acos(0.25);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572085789090.png" alt="1572085789090"></p>
<h4 id="反正弦函数"><a href="#反正弦函数" class="headerlink" title="反正弦函数"></a>反正弦函数</h4><ul>
<li>求x的反正弦值。asin(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select asin(0.25);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572086207817.png" alt="1572086207817"></p>
<h4 id="反正切函数"><a href="#反正切函数" class="headerlink" title="反正切函数"></a>反正切函数</h4><ul>
<li>求x的反正切值。atan(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select atan(2.5);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572086557657.png" alt="1572086557657"></p>
<ul>
<li>求x反正切值，参数是弧度。atan2(n,m)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select atan2(-0.8,2);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572150131302.png" alt="1572150131302"></p>
<h4 id="平均值函数"><a href="#平均值函数" class="headerlink" title="平均值函数"></a>平均值函数</h4><ul>
<li>返回一个表达式的平均值，expression是一个字段。avg(expression)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select avg(alexa) from websites;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572243526558.png" alt="1572243526558"></p>
<h4 id="最小整数函数"><a href="#最小整数函数" class="headerlink" title="最小整数函数"></a>最小整数函数</h4><p>返回大于或等于x的最小整数。</p>
<ul>
<li>ceil(x)</li>
<li>ceiling(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select ceil(1.5);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572243874860.png" alt="1572243874860"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select ceiling(1.5);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572243903812.png" alt="1572243903812"></p>
<h4 id="最大整数函数"><a href="#最大整数函数" class="headerlink" title="最大整数函数"></a>最大整数函数</h4><ul>
<li>返回小于或等于x的最大整数。floor(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select floor(1.5);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572249153923.png" alt="1572249153923"></p>
<h4 id="余弦函数"><a href="#余弦函数" class="headerlink" title="余弦函数"></a>余弦函数</h4><ul>
<li>求余弦值（参数是弧度）。cos(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select cos(2);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572244342671.png" alt="1572244342671"></p>
<h4 id="余切函数"><a href="#余切函数" class="headerlink" title="余切函数"></a>余切函数</h4><ul>
<li>求余切值（参数是弧度）。cot(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select cot(2);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572244516352.png" alt="1572244516352"></p>
<h4 id="统计记录"><a href="#统计记录" class="headerlink" title="统计记录"></a>统计记录</h4><ul>
<li>返回查询的记录总数，参数为一个字段或者*号。count(expression)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select count(id) from websites;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572245067511.png" alt="1572245067511"></p>
<h4 id="弧度转角度"><a href="#弧度转角度" class="headerlink" title="弧度转角度"></a>弧度转角度</h4><ul>
<li>将弧度转角度。DEGREES(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select degrees(3.1415926);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572247642656.png" alt="1572247642656"></p>
<h4 id="整除函数"><a href="#整除函数" class="headerlink" title="整除函数"></a>整除函数</h4><ul>
<li>n为被除数，m为除数</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select 10 div 5;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572248088092.png" alt="1572248088092"></p>
<h4 id="e的x次方"><a href="#e的x次方" class="headerlink" title="e的x次方"></a>e的x次方</h4><ul>
<li>返回e的x次方。exp(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select exp(3);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572248962039.png" alt="1572248962039"></p>
<h4 id="列表最大值"><a href="#列表最大值" class="headerlink" title="列表最大值"></a>列表最大值</h4><ul>
<li>返回列表中的最大值。greatest(13,22,41)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select greatest(13,22,41);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572249329035.png" alt="1572249329035"></p>
<h4 id="列表最小值"><a href="#列表最小值" class="headerlink" title="列表最小值"></a>列表最小值</h4><ul>
<li>返回列表中的最小值。least（13，22，41）</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select least(13,22,41);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572249451325.png" alt="1572249451325"></p>
<h4 id="自然对数函数"><a href="#自然对数函数" class="headerlink" title="自然对数函数"></a>自然对数函数</h4><ul>
<li>返回数字x的自然对数。ln(x)</li>
<li>返回自然对数，以e为底的对数。log(x)</li>
<li>返回以10为底的对数。log10(100)</li>
<li>返回以2为底的对数。log2(8)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select ln(2);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572256910711.png" alt="1572256910711"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select log(20.085536923188);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572425002692.png" alt="1572425002692"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select log10(100);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572425057962.png" alt="1572425057962"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select log2(8);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572425225851.png" alt="1572425225851"></p>
<h4 id="最大值函数"><a href="#最大值函数" class="headerlink" title="最大值函数"></a>最大值函数</h4><ul>
<li>返回字段x中的最大值。max(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select max(alexa) from websites;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572426463247.png" alt="1572426463247"></p>
<h4 id="最小值函数"><a href="#最小值函数" class="headerlink" title="最小值函数"></a>最小值函数</h4><ul>
<li>返回字段x中的最小值。min(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select min(alexa) from websites;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572426533618.png" alt="1572426533618"></p>
<h4 id="求余函数"><a href="#求余函数" class="headerlink" title="求余函数"></a>求余函数</h4><ul>
<li>返回x除以y以后的余数。mod(5,2)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select mod(5,2);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572426825178.png" alt="1572426825178"></p>
<h4 id="圆周率函数"><a href="#圆周率函数" class="headerlink" title="圆周率函数"></a>圆周率函数</h4><ul>
<li>返回圆周率函数。pi()</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select pi();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572511901871.png" alt="1572511901871"></p>
<h4 id="求次方函数"><a href="#求次方函数" class="headerlink" title="求次方函数"></a>求次方函数</h4><p>​    返回x的y次方</p>
<ul>
<li>pow(x,y)</li>
<li>power(x,y)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select pow(2,3);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572512279462.png" alt="1572512279462"></p>
<h4 id="转弧度函数"><a href="#转弧度函数" class="headerlink" title="转弧度函数"></a>转弧度函数</h4><ul>
<li>将角度转换为弧度。radians(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select radians(180);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572512512155.png" alt="1572512512155"></p>
<h4 id="随机函数"><a href="#随机函数" class="headerlink" title="随机函数"></a>随机函数</h4><ul>
<li>返回0到1的随机数。rand()</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select rand();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572512733708.png" alt="1572512733708"></p>
<h4 id="最近的整数"><a href="#最近的整数" class="headerlink" title="最近的整数"></a>最近的整数</h4><ul>
<li>返回离x最近的整数。round(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select round(1.23);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572512907630.png" alt="1572512907630"></p>
<h4 id="返回x的函数"><a href="#返回x的函数" class="headerlink" title="返回x的函数"></a>返回x的函数</h4><ul>
<li>x是负数、0、正数分别返回，-1、0、1。sign(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select sign(-10);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572513078456.png" alt="1572513078456"></p>
<h4 id="正弦函数"><a href="#正弦函数" class="headerlink" title="正弦函数"></a>正弦函数</h4><ul>
<li>求正弦值函数（参数是弧度）。sin(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select sin(radians(30));</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572513216000.png" alt="1572513216000"></p>
<h4 id="平方根函数"><a href="#平方根函数" class="headerlink" title="平方根函数"></a>平方根函数</h4><ul>
<li>返回x的平方根。sqrt(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select sqrt(9);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572513322697.png" alt="1572513322697"></p>
<h4 id="字段数总和"><a href="#字段数总和" class="headerlink" title="字段数总和"></a>字段数总和</h4><ul>
<li>返回指定字段的总和。sum(expression)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select sum(alexa) from websites;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572513451340.png" alt="1572513451340"></p>
<h4 id="正切函数"><a href="#正切函数" class="headerlink" title="正切函数"></a>正切函数</h4><ul>
<li>求正切函数（参数是弧度）。TAN（x）</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select tan(1.75);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572513574056.png" alt="1572513574056"></p>
<h4 id="保留小数点函数"><a href="#保留小数点函数" class="headerlink" title="保留小数点函数"></a>保留小数点函数</h4><ul>
<li>返回数值x保留多少y位小数点。truncate(x,y)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select truncate(1.23456,3);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572513740031.png" alt="1572513740031"></p>
<h3 id="日期类型"><a href="#日期类型" class="headerlink" title="日期类型"></a>日期类型</h3><h4 id="加天数函数"><a href="#加天数函数" class="headerlink" title="加天数函数"></a>加天数函数</h4><ul>
<li>计算起始日期d加上n天的日期。addDate(d,n)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select adddate(&quot;2019-11-1&quot;,INTERVAL 10 DAY);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572594559005.png" alt="1572594559005"></p>
<h4 id="加时间函数"><a href="#加时间函数" class="headerlink" title="加时间函数"></a>加时间函数</h4><ul>
<li>时间t加上n秒的时间。addTime(t,n)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select addTime(&apos;2019-11-1 11:11:11&apos;,5);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572594846610.png" alt="1572594846610"></p>
<h4 id="当前日期"><a href="#当前日期" class="headerlink" title="当前日期"></a>当前日期</h4><p>返回当前日期</p>
<ul>
<li>curdate()</li>
<li>current_date()</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select curdate();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572595076152.png" alt="1572595076152"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select current_date();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572595110739.png" alt="1572595110739"></p>
<h4 id="当前时间"><a href="#当前时间" class="headerlink" title="当前时间"></a>当前时间</h4><p>返回当前时间</p>
<ul>
<li>current_time()</li>
<li>curtime()</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select current_time();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572595371073.png" alt="1572595371073"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select curtime();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572595406062.png" alt="1572595406062"></p>
<h4 id="当前日期和时间"><a href="#当前日期和时间" class="headerlink" title="当前日期和时间"></a>当前日期和时间</h4><ul>
<li>返回当前日期和时间。current_timestamp()</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select current_timestamp();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572595554860.png" alt="1572595554860"></p>
<h4 id="计算相隔天数"><a href="#计算相隔天数" class="headerlink" title="计算相隔天数"></a>计算相隔天数</h4><ul>
<li>计算日期d1-&gt;d2之间相隔的天数。datediff(d1,d2)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select datediff(&apos;2012-1-1&apos;,&apos;2013-1-1&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572596545176.png" alt="1572596545176"></p>
<h4 id="表达式显示日期"><a href="#表达式显示日期" class="headerlink" title="表达式显示日期"></a>表达式显示日期</h4><ul>
<li>按表达式f的要求显示日期d。date_format(d,f)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select date_format(&apos;2011-11-11 11:11:11&apos;,&apos;%d-%m-%Y %r&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572597423927.png" alt="1572597423927"></p>
<h4 id="显示日期部分"><a href="#显示日期部分" class="headerlink" title="显示日期部分"></a>显示日期部分</h4><ul>
<li>返回日期值d的日期部分。day(d)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select day(&apos;2017-6-15&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572611679828.png" alt="1572611679828"></p>
<h4 id="显示星期函数"><a href="#显示星期函数" class="headerlink" title="显示星期函数"></a>显示星期函数</h4><ul>
<li>返回日期d是星期几。dayname(d)</li>
<li>日期d今天是星期几，1星期日，2星期一以此类推。dayofweek(d)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select dayname(&apos;2019-11-1&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572612179011.png" alt="1572612179011"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select dayofweek(&apos;2019-11-1&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572612690723.png" alt="1572612690723"></p>
<h4 id="显示本月的天数"><a href="#显示本月的天数" class="headerlink" title="显示本月的天数"></a>显示本月的天数</h4><ul>
<li>计算日期d是本月的第几天。dayofmonth(d)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select dayofmonth(&apos;2017-11-6&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572612495288.png" alt="1572612495288"></p>
<h4 id="显示到本年的天数"><a href="#显示到本年的天数" class="headerlink" title="显示到本年的天数"></a>显示到本年的天数</h4><ul>
<li>计算日期d是本年的第几天。dayofyear(‘2016-11-1’);</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select dayofyear(&apos;2016-11-1&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572613190270.png" alt="1572613190270"></p>
<h3 id="高级函数"><a href="#高级函数" class="headerlink" title="高级函数"></a>高级函数</h3><h4 id="二进制编码"><a href="#二进制编码" class="headerlink" title="二进制编码"></a>二进制编码</h4><ul>
<li>返回x的二进制编码。bin(x)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select bin(15);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572614764654.png" alt="1572614764654"></p>
<h4 id="字符串转二进制"><a href="#字符串转二进制" class="headerlink" title="字符串转二进制"></a>字符串转二进制</h4><ul>
<li>将字符串s转换为二进制字符串。binary(s)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select binary(&apos;runmb&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572615667584.png" alt="1572615667584"></p>
<h4 id="条件函数"><a href="#条件函数" class="headerlink" title="条件函数"></a>条件函数</h4><ul>
<li>case表示函数开始，end表示函数结束。如果condition 1成立，则返回result1，如果condition 2成立，则返回result2，如果全部不成立则返回result。当一个成立后，后面就不执行了。</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">select case </span><br><span class="line">when 1 &lt; 0 then &apos;1&gt;0&apos;</span><br><span class="line">when 2 &gt; 0 then &apos;2&gt;0&apos;</span><br><span class="line">else &apos;3&gt;0&apos;</span><br><span class="line">end;</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572859091222.png" alt="1572859091222"></p>
<h4 id="转换数据"><a href="#转换数据" class="headerlink" title="转换数据"></a>转换数据</h4><ul>
<li>转换数据类型。cast(x as type)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select cast(&apos;2017-08-29&apos; as date);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572860557822.png" alt="1572860557822"></p>
<h4 id="非空函数"><a href="#非空函数" class="headerlink" title="非空函数"></a>非空函数</h4><ul>
<li>返回参数中的第一个非空表达式（从左到右）。coalesce（expr1,expr2,expr3）</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select coalesce(null,null,&apos;123&apos;,null,&apos;456&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572861635132.png" alt="1572861635132"></p>
<h4 id="服务器连接数"><a href="#服务器连接数" class="headerlink" title="服务器连接数"></a>服务器连接数</h4><ul>
<li>返回服务器的连接数。connection_id()</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select connection_id();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572862035170.png" alt="1572862035170"></p>
<h4 id="进制数转换"><a href="#进制数转换" class="headerlink" title="进制数转换"></a>进制数转换</h4><ul>
<li>返回f1进制数变成f2进制数。conv(x,10,2);</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select conv(15,10,2);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572862452239.png" alt="1572862452239"></p>
<h4 id="当前用户"><a href="#当前用户" class="headerlink" title="当前用户"></a>当前用户</h4><p>返回当前用户。</p>
<ul>
<li>current_user()</li>
<li>session_user()</li>
<li>system_user()</li>
<li>user()</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select current_user();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572862970285.png" alt="1572862970285"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select session_user();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1573025960234.png" alt="1573025960234"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select system_user();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1573026020175.png" alt="1573026020175"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select user();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1573026126803.png" alt="1573026126803"></p>
<h4 id="当前数据库"><a href="#当前数据库" class="headerlink" title="当前数据库"></a>当前数据库</h4><ul>
<li>返回当前数据库名。database()</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select database();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572863214780.png" alt="1572863214780"></p>
<h4 id="如果函数"><a href="#如果函数" class="headerlink" title="如果函数"></a>如果函数</h4><ul>
<li>如果表达式expr成立，返回结果v1；否则返回结果v2。if(expr,v1,v2)</li>
</ul>
<p>实例:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select if(1&gt;0,&apos;1&apos;,&apos;0&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572864200577.png" alt="1572864200577"></p>
<h4 id="是否为空函数"><a href="#是否为空函数" class="headerlink" title="是否为空函数"></a>是否为空函数</h4><ul>
<li>如果v1的值不为Null,则返回v1,否则返回v2。ifnull(v1,v2)</li>
<li>判断表达式是否为null。isnull(expression)</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select ifnull(&quot;1&quot;,&apos;123&apos;);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1572864439679.png" alt="1572864439679"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select isnull(alexa);</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1573026263869.png" alt="1573026263869"></p>
<h4 id="最后生成的Auto-increment值"><a href="#最后生成的Auto-increment值" class="headerlink" title="最后生成的Auto_increment值"></a>最后生成的Auto_increment值</h4><ul>
<li>返回最近生成的auto_increment值。last_insert_id()</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select last_insert_id();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1573025615288.png" alt="1573025615288"></p>
<h4 id="显示数据库版本"><a href="#显示数据库版本" class="headerlink" title="显示数据库版本"></a>显示数据库版本</h4><ul>
<li>返回数据库的版本号。</li>
</ul>
<p>实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select version();</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5Cadmin%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1573026304666.png" alt="1573026304666"></p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/blog/tags/MySQL/" rel="tag"># MySQL</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/blog/2019/10/07/数据库系统表相关学习/" rel="next" title="数据库系统表相关学习">
                <i class="fa fa-chevron-left"></i> 数据库系统表相关学习
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Blackghost</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/blog/archives/">
              
                  <span class="site-state-item-count">6</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            

            
              
              
              <div class="site-state-item site-state-tags">
                
                  <span class="site-state-item-count">15</span>
                  <span class="site-state-item-name">标签</span>
                
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#背景"><span class="nav-number">1.</span> <span class="nav-text">背景</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#前提条件"><span class="nav-number">2.</span> <span class="nav-text">前提条件</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#MySQL函数"><span class="nav-number">3.</span> <span class="nav-text">MySQL函数</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#字符串型"><span class="nav-number">3.1.</span> <span class="nav-text">字符串型</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#ASCII函数"><span class="nav-number">3.1.1.</span> <span class="nav-text">ASCII函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#长度计算函数"><span class="nav-number">3.1.2.</span> <span class="nav-text">长度计算函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#合并字符串函数"><span class="nav-number">3.1.3.</span> <span class="nav-text">合并字符串函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查找多个字符位置"><span class="nav-number">3.1.4.</span> <span class="nav-text">查找多个字符位置</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查找单个字符位置"><span class="nav-number">3.1.5.</span> <span class="nav-text">查找单个字符位置</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#格式化数字函数"><span class="nav-number">3.1.6.</span> <span class="nav-text">格式化数字函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#替换字符串函数"><span class="nav-number">3.1.7.</span> <span class="nav-text">替换字符串函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查找字符串函数"><span class="nav-number">3.1.8.</span> <span class="nav-text">查找字符串函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#转换为小写函数"><span class="nav-number">3.1.9.</span> <span class="nav-text">转换为小写函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#转换为大写函数"><span class="nav-number">3.1.10.</span> <span class="nav-text">转换为大写函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回字符串函数"><span class="nav-number">3.1.11.</span> <span class="nav-text">返回字符串函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#填充字符串函数"><span class="nav-number">3.1.12.</span> <span class="nav-text">填充字符串函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#去除空格函数"><span class="nav-number">3.1.13.</span> <span class="nav-text">去除空格函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#截取字符串函数"><span class="nav-number">3.1.14.</span> <span class="nav-text">截取字符串函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#重复复制字符串"><span class="nav-number">3.1.15.</span> <span class="nav-text">重复复制字符串</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回空格函数"><span class="nav-number">3.1.16.</span> <span class="nav-text">返回空格函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#字符串比较函数"><span class="nav-number">3.1.17.</span> <span class="nav-text">字符串比较函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#分割字符串函数"><span class="nav-number">3.1.18.</span> <span class="nav-text">分割字符串函数</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#数值型"><span class="nav-number">3.2.</span> <span class="nav-text">数值型</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#绝对值函数"><span class="nav-number">3.2.1.</span> <span class="nav-text">绝对值函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#反余弦函数"><span class="nav-number">3.2.2.</span> <span class="nav-text">反余弦函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#反正弦函数"><span class="nav-number">3.2.3.</span> <span class="nav-text">反正弦函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#反正切函数"><span class="nav-number">3.2.4.</span> <span class="nav-text">反正切函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#平均值函数"><span class="nav-number">3.2.5.</span> <span class="nav-text">平均值函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#最小整数函数"><span class="nav-number">3.2.6.</span> <span class="nav-text">最小整数函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#最大整数函数"><span class="nav-number">3.2.7.</span> <span class="nav-text">最大整数函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#余弦函数"><span class="nav-number">3.2.8.</span> <span class="nav-text">余弦函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#余切函数"><span class="nav-number">3.2.9.</span> <span class="nav-text">余切函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#统计记录"><span class="nav-number">3.2.10.</span> <span class="nav-text">统计记录</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#弧度转角度"><span class="nav-number">3.2.11.</span> <span class="nav-text">弧度转角度</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#整除函数"><span class="nav-number">3.2.12.</span> <span class="nav-text">整除函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#e的x次方"><span class="nav-number">3.2.13.</span> <span class="nav-text">e的x次方</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#列表最大值"><span class="nav-number">3.2.14.</span> <span class="nav-text">列表最大值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#列表最小值"><span class="nav-number">3.2.15.</span> <span class="nav-text">列表最小值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#自然对数函数"><span class="nav-number">3.2.16.</span> <span class="nav-text">自然对数函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#最大值函数"><span class="nav-number">3.2.17.</span> <span class="nav-text">最大值函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#最小值函数"><span class="nav-number">3.2.18.</span> <span class="nav-text">最小值函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#求余函数"><span class="nav-number">3.2.19.</span> <span class="nav-text">求余函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#圆周率函数"><span class="nav-number">3.2.20.</span> <span class="nav-text">圆周率函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#求次方函数"><span class="nav-number">3.2.21.</span> <span class="nav-text">求次方函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#转弧度函数"><span class="nav-number">3.2.22.</span> <span class="nav-text">转弧度函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#随机函数"><span class="nav-number">3.2.23.</span> <span class="nav-text">随机函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#最近的整数"><span class="nav-number">3.2.24.</span> <span class="nav-text">最近的整数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回x的函数"><span class="nav-number">3.2.25.</span> <span class="nav-text">返回x的函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#正弦函数"><span class="nav-number">3.2.26.</span> <span class="nav-text">正弦函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#平方根函数"><span class="nav-number">3.2.27.</span> <span class="nav-text">平方根函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#字段数总和"><span class="nav-number">3.2.28.</span> <span class="nav-text">字段数总和</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#正切函数"><span class="nav-number">3.2.29.</span> <span class="nav-text">正切函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#保留小数点函数"><span class="nav-number">3.2.30.</span> <span class="nav-text">保留小数点函数</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#日期类型"><span class="nav-number">3.3.</span> <span class="nav-text">日期类型</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#加天数函数"><span class="nav-number">3.3.1.</span> <span class="nav-text">加天数函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#加时间函数"><span class="nav-number">3.3.2.</span> <span class="nav-text">加时间函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#当前日期"><span class="nav-number">3.3.3.</span> <span class="nav-text">当前日期</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#当前时间"><span class="nav-number">3.3.4.</span> <span class="nav-text">当前时间</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#当前日期和时间"><span class="nav-number">3.3.5.</span> <span class="nav-text">当前日期和时间</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#计算相隔天数"><span class="nav-number">3.3.6.</span> <span class="nav-text">计算相隔天数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#表达式显示日期"><span class="nav-number">3.3.7.</span> <span class="nav-text">表达式显示日期</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#显示日期部分"><span class="nav-number">3.3.8.</span> <span class="nav-text">显示日期部分</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#显示星期函数"><span class="nav-number">3.3.9.</span> <span class="nav-text">显示星期函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#显示本月的天数"><span class="nav-number">3.3.10.</span> <span class="nav-text">显示本月的天数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#显示到本年的天数"><span class="nav-number">3.3.11.</span> <span class="nav-text">显示到本年的天数</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#高级函数"><span class="nav-number">3.4.</span> <span class="nav-text">高级函数</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#二进制编码"><span class="nav-number">3.4.1.</span> <span class="nav-text">二进制编码</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#字符串转二进制"><span class="nav-number">3.4.2.</span> <span class="nav-text">字符串转二进制</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#条件函数"><span class="nav-number">3.4.3.</span> <span class="nav-text">条件函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#转换数据"><span class="nav-number">3.4.4.</span> <span class="nav-text">转换数据</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#非空函数"><span class="nav-number">3.4.5.</span> <span class="nav-text">非空函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#服务器连接数"><span class="nav-number">3.4.6.</span> <span class="nav-text">服务器连接数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#进制数转换"><span class="nav-number">3.4.7.</span> <span class="nav-text">进制数转换</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#当前用户"><span class="nav-number">3.4.8.</span> <span class="nav-text">当前用户</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#当前数据库"><span class="nav-number">3.4.9.</span> <span class="nav-text">当前数据库</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#如果函数"><span class="nav-number">3.4.10.</span> <span class="nav-text">如果函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#是否为空函数"><span class="nav-number">3.4.11.</span> <span class="nav-text">是否为空函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#最后生成的Auto-increment值"><span class="nav-number">3.4.12.</span> <span class="nav-text">最后生成的Auto_increment值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#显示数据库版本"><span class="nav-number">3.4.13.</span> <span class="nav-text">显示数据库版本</span></a></li></ol></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Blackghost</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/blog/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/blog/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/blog/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/blog/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/blog/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/blog/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
